﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Objects;

namespace FarmacieDAL
{
    public class ArhivaManager
    {
        private static List<Arhiva> toateArhivele;
        private static FarmacieEntities entities;

        public static void Initialize(FarmacieEntities entitiesContext)
        {
            toateArhivele = new List<Arhiva>();
            entities = entitiesContext;

            toateArhivele = entities.Arhiva.ToList();
        }

        public static void Refresh()
        {
            toateArhivele.Clear();
            entities.Refresh(RefreshMode.StoreWins, entities.Arhiva);
            toateArhivele.AddRange(entities.Arhiva);
        }

        public static List<Arhiva> ToateArhivele
        {
            get
            {
                return toateArhivele;
            }
        }
    }
}
